Skip to content

Keep explicit AdviceDate values in CNBC readers - #22

Merged
quantconnect-kronos[bot] merged 1 commit into
masterfrom
kronos/bug-20-preserve-cnbc-advice-date
Nov 20, 2026
Merged

quantconnect-kronos[bot] merged 1 commit into
masterfrom
kronos/bug-20-preserve-cnbc-advice-date

Conversation

@quantconnect-kronos

Copy link
Copy Markdown
Contributor

Closes #20

What changed

QuiverCNBC.Reader and QuiverCNBCsUniverse.Reader applied .AddDays(-1) to the whole parse-or-fallback expression for AdviceDate, so an advice date stored in the CSV came back one day early. The downloader writes that column unshifted. The offset now applies only to the fallback used when the column is empty, as #19 does for the insider trading readers' FileDate.

  • Explicit AdviceDate: returned as stored (20260507 → 2026-05-07, was 2026-05-06).
  • Empty AdviceDate: unchanged, still the read date minus one day.
  • Time / EndTime: unchanged.

Tests

  • Reader_ParsesCompactFormat and UniverseReader_ParsesCompactFormat now expect the stored advice date.
  • New UniverseReader_EmptyAdviceDateFallsBackToDateMinusOne covers the universe reader's empty-column fallback, which nothing tested before (the per-security reader already had Reader_EmptyAdviceDateFallsBackToUploadedMinusOne).

Full suite, as CI runs it:

dotnet build ./QuantConnect.DataSource.csproj /p:Configuration=Release
dotnet build ./tests/Tests.csproj /p:Configuration=Release
dotnet test ./tests/bin/Release/net10.0/Tests.dll
Passed!  - Failed: 0, Passed: 90, Skipped: 0, Total: 90

Tested end to end with a backtest on AAL from 2026-05-28 to 2026-06-05 that subscribes to QuiverCNBCs and the QuiverCNBCsUniverse, reading the dataset's real files, where the 2026-06-03 upload stores advice date 20260602:

  • With this change: both the custom data and the universe report AdviceDate=2026-06-02.
  • On master: the universe reports AdviceDate=2026-06-01.

Question

The downloader leaves the advice date column empty when the advice date equals the upload date (QuiverCNBCDataDownloader.Run, uploadDate == processDate). The fallback returns the upload date minus one day, so those rows come back a day before their advice date. The issue asks to keep the fallback as it is, so this change leaves it alone. Should the fallback return the upload date itself? That would be a separate change.

QuiverCNBC and QuiverCNBCsUniverse subtracted a day from the advice
date even when the CSV stored it explicitly. Apply the one-day offset
only to the fallback used when the column is empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. The offset now applies only to the empty-column fallback in both CNBC readers, matching what the downloader writes (processDate unshifted) and #20's required outcome. The updated Reader_ParsesCompactFormat and UniverseReader_ParsesCompactFormat fail against master's readers (Expected 2026-05-07, But was 2026-05-06) and pass with this change; the new universe fallback test covers the untested branch.

On the description's question: the fallback returning the upload date minus one day contradicts the downloaders' own comments (both CNBC and insider trading), so I opened #23 for it rather than holding this change.

Risk set to risk:low: a two-line bug fix to a metadata field, easy to revert, with regression tests, green CI and an end-to-end run; Time/EndTime and the fallback are unchanged.

@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot added risk:low Low risk and removed kronos:review:working review: in progress labels Nov 20, 2026
@quantconnect-kronos quantconnect-kronos Bot added the kronos:review Request review label Nov 20, 2026
@quantconnect-kronos-reviewer quantconnect-kronos-reviewer Bot added kronos:review:queued review: queued and removed kronos:review Request review labels Nov 20, 2026
@quantconnect-kronos-reviewer-2 quantconnect-kronos-reviewer-2 Bot added kronos:review:working review: in progress and removed kronos:review:queued review: queued labels Nov 20, 2026

@quantconnect-kronos-reviewer-2 quantconnect-kronos-reviewer-2 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Independently verified the full Release suite passes (90/90), while the two updated explicit-date tests fail against the base readers with the expected one-day discrepancy.

Also tested end to end: both QuiverCNBCs and QuiverCNBCsUniverse return the stored 20260602 advice date as 2026-06-02 rather than 2026-06-01, with Time and EndTime unchanged. The fix meets #20 without changing the empty-column fallback.

The sibling QuiverInsiderTrading and QuiverInsiderTradingUniverse explicit-FileDate bug is handled separately in #19; no additional implementation needs this CNBC correction.

@quantconnect-kronos-reviewer-2 quantconnect-kronos-reviewer-2 Bot removed the kronos:review:working review: in progress label Nov 20, 2026
@quantconnect-kronos
quantconnect-kronos Bot merged commit bea8a7d into master Nov 20, 2026
1 check passed
@quantconnect-kronos quantconnect-kronos Bot removed the kronos:develop:working develop: in progress label Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:low Low risk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CNBC readers subtract a day from explicit AdviceDate values

0 participants